import cn.spring.entity.Greeting;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ShangJi2 {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        Greeting zhangGa = (Greeting) context.getBean("zhangGaEr");
        Greeting rodEr = (Greeting) context.getBean("rodEr");
        zhangGa.sayGreeting();
        rodEr.sayGreeting();
    }
}
